
function imagePreview(input){
	/*<img class="showImg" src="../img/moren.jpg" data-src="" onerror="javascript:this.src='../img/moren.jpg'">
									<img src="../img/delete.png" class="deleteShowImg">*/
	var files = input.files[0];
	var div = document.createElement("div");
	var img = document.createElement("img");
	img.className = 'showImg';
	var imgDelete = document.createElement("img");
	imgDelete.className = 'deleteShowImg';
	div.className = 'showImgWrap';
	imgDelete.src = $('.deleteImgSrc').val();
	img.file = files;
	var pvImg = new Image();
	pvImg.src = img;
	div.append(img);
	div.append(imgDelete);
	$(input).parent().get(0).append(div);
	var reader = new FileReader();
        reader.onload = (function(aImg) {
          return function(e) {
            aImg.src = e.target.result;
          };
        })(img);
        reader.readAsDataURL(files);
}
window.onload=function(){
	//删除图片
	$(document).on("click",".deleteShowImg",function(e){
		e.preventDefault();
		$(this).parent().remove();
		$(this).parent().parent().find('input[type=file]').val('');
	})
	$('.deleteInitImg').on('click',function(e){
		e.preventDefault();
		$(this).parent().remove();
		$(this).parent().parent().find('input[type=file]').val('');
	})
}
